package com.qf.smsplatform.controller;
/*2021/10/30*/

import com.github.pagehelper.PageInfo;
import com.qf.smsplatform.cache.TAcountRecordCache;
import com.qf.smsplatform.dto.R;
import com.qf.smsplatform.pojo.TAcountRecord;
import com.qf.smsplatform.service.TAcountRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @YuTao
 */
@RestController
@RequestMapping("/record")
public class TAcountRecordController {

    private TAcountRecordService tAcountRecordService;
    @Autowired
    public void settAcountRecordService(TAcountRecordService tAcountRecordService) {
        this.tAcountRecordService = tAcountRecordService;
    }

    @RequestMapping("/page")
    public R selectPage(int pageNum,int pageSize){
        PageInfo<TAcountRecord> pageInfo = tAcountRecordService.selectPage(pageNum, pageSize);
        return R.setOk(pageInfo);
    }
    @RequestMapping("/update")
    public R updateRecord(TAcountRecord acountRecord){
        tAcountRecordService.updateTAcount(acountRecord);
        return R.setOk();
    }
    @RequestMapping("/insert")
    public R insertRecord(@RequestBody TAcountRecord tAcountRecord){
        tAcountRecordService.insertTAcount(tAcountRecord);
        return R.setOk();
    }

}
